#pragma once
#include "SDLText.h"

class TypeWriter : public SDLText
{
public:
	TypeWriter(int lettersPerSecond, std::string content, std::string fontPath, int size, int renderMethod);
	~TypeWriter();

	bool ContentEquals(const std::string str){ return (str == mTextToWrite); }
	bool IsCompleted(){ return (mTextToWrite == mContent && !mIsWriting); }
	bool IsWriting(){ return mIsWriting; }

	void Update();
	void Reset();
	void Start();
	void SetNewContent(const std::string text)
	{
		mTextToWrite = text;
		Reset();
	}

private:
	std::string mTextToWrite;
	bool mIsWriting;
	int mNowLetterIndex;
	int mLettersPerSecond;
	float mWriteTimer;
};